<?php
/**
 * Created by PhpStorm.
 * User: Egg
 * Date: 2018/3/22
 * Time: 8:37
 */

namespace Common\Common;

function print_json_data($stateCode, $data, $message)
{
    $result['stateCode'] = $stateCode;
    $result['data'] = $data;
    $result['message'] = $message;
    echo json_encode($result);
}

function pack_data($stateCode, $data, $message)
{
    $result['stateCode'] = $stateCode;
    $result['data'] = $data;
    $result['message'] = $message;
    return $result;
}

function request_method_error()
{
    $result['stateCode'] = '400';
    $result['data'] = '';
    $result['message'] = 'INVALID REQUEST';
    echo json_encode($result);
}

function request_parameter_invalid()
{
    $result['stateCode'] = '-1';
    $result['data'] = '';
    $result['message'] = ' Invalid request parameter';
    echo json_encode($result);
}

function aoto_print_json_data($data)
{
    echo 'hello world';
}